Subscribe Us

Responsive Advertisement

Advertisement

1624A Plus One on the Subset codeforces solution in cpp

 

1624A Plus One on the Subset codeforces solution in cpp

by ujjal roy



#include<bits/stdc++.h>

using namespace std;

main()

{

    long long int t,n,i,max=-1,min=10000000000,a;

    cin>>t;


    while(t--)

    {

        max=-1,min=10000000000;

        cin>>n;

        for(i=0;i<n;i++)

        {

            cin>>a;

            if(a<min) min=a;

            if(a>max) max=a;


        }

        cout<<max-min<<endl;

    }


    return 0;

}


Post a Comment

0 Comments